//
//  BLLoginViewController.m
//  百思不得姐
//
//  Created by hbl on 16/3/18.
//  Copyright © 2016年 hbl. All rights reserved.
//

#import "BLLoginViewController.h"

@interface BLLoginViewController ()

- (IBAction)close:(id)sender;

@property (weak, nonatomic) IBOutlet UITextField *userNameTextField;
@property (weak, nonatomic) IBOutlet UITextField *passwordTextField;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *loginViewLeftMargin;
- (IBAction)registerButton:(id)sender;

@end

@implementation BLLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
}


- (IBAction)close:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
}
- (IBAction)registerButton:(id)sender {
    [self.view endEditing:YES];
    UIButton *btn = sender;
    if (self.loginViewLeftMargin.constant == 0) {
        self.loginViewLeftMargin.constant = - self.view.frame.size.width;
        [btn setTitle:@"已有账号?" forState:UIControlStateNormal];
    }else{
        self.loginViewLeftMargin.constant = 0;
        [btn setTitle:@"注册账号" forState:UIControlStateNormal];
    }
    
    [UIView animateWithDuration:0.25 animations:^{
        [self.view layoutIfNeeded];
    } ];
}


@end
